<?php

namespace StudyBuddy\Controllers;
 
use StudyBuddy\Controllers\Stick;

/**
 * Controller responsible for removing
 * the 'sticky' attribute from a question
 * 
 *
 */
class Unstick extends Stick
{
	protected function main(){
		$this->getQuestion()
		->unsetSticky()
		->redirect();
	}
	
	protected function unsetSticky(){
		$this->oQuestion->offsetUnset('i_sticky');
		$this->oQuestion->touch()->save();

		return $this;
	}
}
